package File;

import java.io.File;
import java.util.Scanner;
public class infoFile {

	static String pathfolder;
	private static Scanner sc;
	public static void setpath(String a){
		pathfolder=a;
	}
	public static void list(){// tra ve danh sach cac file,thuc muc
		File dir=new File(pathfolder);
        File[] listFile = dir.listFiles();
 
        System.out.println("Danh sách file trong thư mục là: ");
        for (int i = 0; i < listFile.length; i++) {
            if (listFile[i].isFile()) {
                System.out.println(listFile[i].getName());
            }
        }
        System.out.println("Danh sách thưc mục trong thư mục là: ");
        for (int i = 0; i < listFile.length; i++) {
            if (listFile[i].isDirectory()) {
                System.out.println(listFile[i].getName());
            }
        }
    }
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		System.out.println("nhap duong dan");
		sc = new Scanner(System.in);
		setpath(sc.nextLine());
		list();
	}

}
